﻿@model WebBarracoDoSom.Models.Emprestimo

@{
    ViewBag.Title = "Realizar Empréstimo";
}

<h2>Alugar Instrumento</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Empréstimo</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.User_ID): @Session["UserName"]
        </div>
        
        <div class="editor-label">
            @Html.LabelFor(model => model.DataRealizacao): @DateTime.Now.ToShortDateString()
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.DataDevolucao): @DateTime.Now.AddDays(double.Parse(Session["TempoEmprestimo"].ToString())).ToShortDateString()
        </div>
        
        <div class="editor-label">
            @Html.LabelFor(model => model.Valor): @ViewBag.ValorDiaria
        </div>

        <p>
            <input type="submit" value="Alugar" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Voltar para a lista", "SearchIndex", "Instrumentos")
</div>
